<?php

/*************************************************************************

	FILE INCLUDE

**************************************************************************/
include_once '../lib/Template.class.php';
$debug_mode_value = 0;



/*************************************************************************

	USER SCRIPT

***************************************************************************/
$userscript =<<<js
    <script type="text/javascript">
        <!--

        //-->
    </script>
js;


/*************************************************************************

		PAGE MAIN PROCESS

***************************************************************************/
(!empty($_POST['ner_nm']))? $ner_nm = $_POST['ner_nm'] : $ner_nm = "";
(!empty($_POST['ner_cd']))? $ner_cd = $_POST['ner_cd'] : $ner_cd = "";
(!empty($_POST['change_ner']))? $change_ner = $_POST['change_ner'] : $change_ner = "";
(!empty($_POST['operation']))? $operation = $_POST['operation'] : $operation = "";



print_rr($_POST);

if($operation=="insert"){
	$db->conn();

	$query="INSERT INTO ner_tb
			(NER_NM)
			VALUES ('$ner_nm');";
	$db->query($query);

	$db->close();
}else if ($operation="delete"){
	$db->conn();

	$query="UPDATE cluster_tb
			SET NER_CD = $change_ner
			WHERE NER_CD = $ner_cd ";
	$db->query($query);

	$query="DELETE FROM ner_tb
			WHERE NER_CD = $ner_cd ";
	$db->query($query);

	$db->close();
}

/*************************************************************************

	TEMPLATE PROCESS

***************************************************************************/
$JSClass->replace("./NerManagement.php");





/*************************************************************************

	AJAX FUNCTION : Template_ function

***************************************************************************/



















?>
